import {NgModule} from '@angular/core';
import {GnJsonFormModule, GnJsonTableModule, GnRouteGuard} from 'geminis-ng';
import {CommonModule} from '@angular/common';
import {RouterModule, Routes} from '@angular/router';
import {TableListComponent} from './table-list.component';
import {DragDropModule} from '@angular/cdk/drag-drop';
import {CategoryTreeModule} from "../category-tree/category-tree.module";
import {TableEditorComponent} from "./table-editor.component";
import {TableEditorColumnButtonComponent} from "./table-column-button.component";
import {NzButtonModule} from "ng-zorro-antd/button";
import {NzIconModule} from "ng-zorro-antd/icon";
import {TableButtonComponent} from "./table-button.component";
import {TableEditorSortButtonComponent} from "./table-sort-button.component";
import {NzUploadModule} from "ng-zorro-antd/upload";

const routes: Routes = [
  {
    path: '',
    component: TableListComponent,
    canActivate: [GnRouteGuard]
  }
];

@NgModule({
  declarations: [
    TableListComponent,
    TableEditorComponent,
    TableEditorColumnButtonComponent,
    TableEditorSortButtonComponent,
    TableButtonComponent
  ],
    imports: [
        RouterModule.forChild(routes),
        CommonModule,
        DragDropModule,

        NzButtonModule,
        NzIconModule,

        CategoryTreeModule,
        GnJsonTableModule,
        GnJsonFormModule,
        NzUploadModule

    ],
  bootstrap: [
    TableEditorComponent,
    TableEditorColumnButtonComponent,
    TableEditorSortButtonComponent,
    TableButtonComponent
  ]
})

export class TableModule {
}
